// 判断类型
//  number、string、boolean、object、BigInt、symbol、undefined、null
function whatType1(tar) {
  const t = typeof tar
  if(t === 'object' && !tar) return 'null'
  if(t === 'object' && tar instanceof Array) return 'array'
  return tar
}
function whatType2(tar) {
  const ans = Object.prototype.toString.call(tar)
  return ans.slice(8, ans.length-1).toLowerCase()
}
function whatType3(tar) {
  const t = typeof tar
  if(t === 'object' && !tar) return 'null'
  if(t === 'object' && tar.constructor === Array) return 'array'
  return tar
}
function whatType4(tar) {
  const t = typeof tar
  if(t === 'object' && !tar) return 'null'
  if(t === 'object' && tar.__proto__ ===  Array.prototype) return 'array'
  return tar
}
// Object.prototype.__proto__ === null
function myInstanceof1 (tar, 
  constructorFunc) {
  const pro = tar.__proto__
  if(pro === null) return false
  if(pro === constructorFunc.prototype){
    return true
  }
  return myInstanceof1(pro, constructorFunc)
}

function myInstanceof2 (tar, 
  constructorFunc) {
  let pro = tar.__proto__
  while(pro) {
    if(pro === constructorFunc.prototype){
      return true
    }
    pro = pro.__proto__
  }
  return false
}